import { Tools } from 'weaver-mobile';
export const getTree = (params) => {
    return Tools.callApi({
        url: '/api/workflow/requestAttention/getTree',
        method: 'POST',
        params,
    });
}

export const getTreeCount = (params) => {
    return Tools.callApi({
        url: '/api/workflow/requestAttention/getTreeCount',
        method: 'POST',
        params,
    });
}

export const batchdelAll = (params) => {
    return Tools.callApi({
        url: '/api/workflow/requestAttention/saveAttention',
        method: 'POST',
        params,
    });
}

export const getSessionkey = (params) => {
	const _url  = '/api/workflow/requestAttention/getSessionkey';
	return Tools.callApi(_url, 'POST',params);
}
export const getCondition = (params) => {
	const _url  = '/api/workflow/requestAttention/getCondition';
	return Tools.callApi(_url, 'GET',params);
}

//关注类型接口
export const getAttentionTypeSet = (params) => {
    let queryParam = {};
	if(params == "com"){
		queryParam.src = "getData2";
	}else{
		queryParam.src = "getData";
	}
    return Tools.callApi({
        url: '/api/workflow/requestAttention/getAttentionTypeSet',
        method: 'POST',
        params:{ ismobile: 1, _ec_device: true ,...queryParam},
    });
}
export const getWorkflowAttentionTypeSet = (params) => {
    let queryParam= { src: "getData2" };
	if(params){
		queryParam.requestid = params
	}
    return Tools.callApi({
        url: '/api/workflow/requestAttention/getAttentionTypeSet',
        method: 'POST',
        params:{ ismobile: 1, _ec_device: true ,...queryParam},
    });
}
export const saveAttentionTypeSet = (params) => {
    return Tools.callApi({
        url: '/api/workflow/requestAttention/saveAttentionTypeSet',
        method: 'POST',
        params,
    });
}
export const saveAttention = (params) => {
    return Tools.callApi({
        url: '/api/workflow/requestAttention/saveAttention',
        method: 'POST',
        params,
    });
}